import axios from "axios"
import qs from 'qs'
const appRequest=function(url,method,data,successCallback){
	if(method==0){
		axios.get(url,{
			params:data
		}).then(function(res){
			return successCallback(res)
		})
	}else if(method==1){
		axios.post(url, qs.stringify(data), {
			headers: {
				'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
			}
		}).then(function(res) {
			return successCallback(res)	
		})
	}
}
export default appRequest